package com.capgemini.remind.service;

import com.capgemini.remind.mapper.DealerPromotionPrivilegeMapper;
import com.capgemini.remind.pojo.DealerPromotionPrivilege;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * @author
 * @date
 */
@Service("dealerPromotionPrivilegeService")
public class DealerPromotionPrivilegeService {
	public final Logger log = LoggerFactory.getLogger(this.getClass());
	@Autowired
	private DealerPromotionPrivilegeMapper dealerPromotionPrivilegeMapper;

	public void checkDealerSMSPrivilege(DealerPromotionPrivilege dealerPromotionPrivilege) {
		DealerPromotionPrivilege dealerSMSPrivilegeTemp = dealerPromotionPrivilegeMapper.queryDealePromotionPrivilegeByDealerId(dealerPromotionPrivilege.getDealerNum());
		if(null != dealerSMSPrivilegeTemp) {
			dealerPromotionPrivilege.setHeaderquartersPromotion(dealerSMSPrivilegeTemp.getHeaderquartersPromotion());
			dealerPromotionPrivilege.setCustomerizedPromotion(dealerSMSPrivilegeTemp.getCustomerizedPromotion());
			dealerPromotionPrivilege.setNoPromotion(dealerSMSPrivilegeTemp.getNoPromotion());
		}
	}
}
